// pages/doctor-news-details/doctor-news-details.js
var app = getApp();
var WxParse = require('../../wxParse/wxParse.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    imgBase: app.globalData.imgUrl,          // 线上图片
    localImg: app.globalData.staticimgUrl,  // 本地图片
    newsId:"",//id
    diaryinfo:"",
    info:"",
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log("用户id:", options.id)
    var newsid = options.id;
    var that = this;
    app.request({
      url: 'system/newsapi/newsdetail',
      data: {
        'newsId': newsid,
      },
      success(res) {
        var article = res.data.newsContent;
        that.setData({
          diaryinfo: res.data,
        })
        WxParse.wxParse('article', 'html', article, that, 5);
      }
    })
    
  }
})